package com.example.algorithm.linkedlist;

public class LinkedListMain {

    public static void main(String[] args) {
        LinkedList<Integer> linkedList = new LinkedList<>();
        for (int i = 0; i < 5; i++) {
            linkedList.addFirst(i);
            System.out.println(linkedList);
        }
        linkedList.add(2, 666);
        System.out.println(linkedList);
        boolean contains = linkedList.contains(1);
        System.out.println(contains);
        contains = linkedList.contains(888);
        System.out.println(contains);
        linkedList.remove(2);
        System.out.println(linkedList);
    }
}
